package example.prototypeBeanInjectSingleton;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class SingletonBeanMain {
	public static void main(String[] args) {
		AnnotationConfigApplicationContext context =
				new AnnotationConfigApplicationContext(PrototypeBeanConfig.class);
		SingletonBean bean = context.getBean(SingletonBean.class);
		PrototypeBean prototypeBean = bean.getPrototypeBean();
		PrototypeBean prototypeBean1 = bean.getPrototypeBean();
		//这两个bean打出来的hashCode不一样，说明这确实是一个prototype类型的bean
		System.out.println(prototypeBean);
		System.out.println(prototypeBean1);
	}
}
